package com.h3c.nem.client;

import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "eos-data",url = "${eos.token.url}")
public interface EosSyncDataClient {

    /**
     * 获取eostoken
     * @param data
     * @return
     */
    @PostMapping(value = "user/v1.0/account/token", consumes = {"application/json"})
    JSONObject getEosToken(@RequestBody String data);

    /**
     * 同步公司所有部门信息
     * http://api.eos-ts.h3c.com/orgbaseinfo/v1.0/views/hrssc_depts
     *
     * @param Authorization
     * @return
     */
    @PostMapping(value = "orgbaseinfo/v1.0/views/hrssc_depts ", consumes = {"application/json"}, headers = {"Authorization={Authorization}"})
    JSONObject queryAllDept(@RequestParam("Authorization") String Authorization) ;

  /**
     * 同步公司所有部门主管信息
     *http://api.eos.h3c.com/orgbaseinfo/v1.0/views/performance_manager_all
     * @param Authorization
     * @return
     */
    @PostMapping(value = "orgbaseinfo/v1.0/views/performance_manager_all ", consumes = {"application/json"}, headers = {"Authorization={Authorization}"})
    JSONObject queryDeptManage(@RequestParam("Authorization") String Authorization) ;

    /**
     * 同步员工
     * @param Authorization
     * @return
     */
    @PostMapping(value = "orgbaseinfo/v1.0/views/inventory_emps", consumes = {"application/json"}, headers = {"Authorization={Authorization}"})
    String syncAllWorker(@RequestParam("Authorization") String Authorization) ;

    /**
     * 同步部门
     * @param Authorization
     * @return
     */
    @PostMapping(value = "orgbaseinfo/v1.0/views/inventory_depts", consumes = {"application/json"}, headers = {"Authorization={Authorization}"})
    JSONObject syncAllDept(@RequestParam("Authorization") String Authorization);

    /**
     * 同步新员工
     * @param Authorization
     * @return
     */
    @PostMapping(value = "orgbaseinfo/v1.0/views/nem_emps", consumes = {"application/json"}, headers = {"Authorization={Authorization}"})
    String syncNewWorker(@RequestParam("Authorization") String Authorization,@RequestBody String data) ;

    /**
     * 查询员工信息
     * @param Authorization
     * @return
     */
    @PostMapping(value = "orgbaseinfo/v1.0/views/inventory_emp_label", consumes = {"application/json"}, headers = {"Authorization={Authorization}"})
    String getWorkerInfo(@RequestParam("Authorization") String Authorization,@RequestBody String data) ;

    /**
     * 同步预备员工
     * @param Authorization
     * @return
     */
    @PostMapping(value = "orgbaseinfo/v1.0/views/nem_waitingentry", consumes = {"application/json"}, headers = {"Authorization={Authorization}"})
    String syncPreWorker(@RequestParam("Authorization") String Authorization,@RequestBody String data) ;

    @PostMapping(value = "orgbaseinfo/v1.0/views/hrss_emp_pa9005_courseinfo", consumes = {"application/json"}, headers = {"Authorization={Authorization}"})
    JSONObject queryTeacherTraining(@RequestParam("Authorization") String Authorization, @RequestBody String data);
}
